/*
 * Failure.cpp
 *
 *  Created on: Jan 27, 2011
 *      Author: bvd
 */

#include "Failure.h"
#include "../State/PowerOnSelfTest.h"

using namespace application;

Failure* Failure::pInstance = 0;

Failure::Failure() {
}

Failure::~Failure() {
	delete pInstance;
}

void Failure::restart(Context* context) {
	context->setCurrentState(PowerOnSelfTest::getInstance());
}

void Failure::exit(Context* context) {
	delete context;
}

Failure* Failure::getInstance() {
	if(!pInstance) {
		pInstance = new Failure();
	}
	return pInstance;
}
